﻿

namespace GameFramework.common
{
    public class Singleton<T>  where T:new()
    {
        private static T _instance;
        private static object singLock = new object();

        public static T Instance
        {
            get
            {
                if (_instance == null)
                {
                    lock (singLock)
                    {
                        if (_instance == null)
                        {
                            _instance = new T();
                        }
                    }
                }

                return _instance;
            }
        }
        
    }
    
    
    
}